﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowRemoteModel.NodeMsg;
using Basic.FlowRemoteModel.NodeMsg.Model;

namespace Basic.FlowGatewayModule.lmpl
{
    internal class FlowNodeMsgService : IFlowNodeMsgService
    {
        public void Delete ( long id )
        {
            new DeleteFlowNodeMsg
            {
                Id = id
            }.Send();
        }

        public FlowNodeMsgData Get ( long id )
        {
            return new GetFlowNodeMsg
            {
                Id = id
            }.Send();
        }

        public FlowNodeMsg[] Gets ( long nodeId )
        {
            return new GetFlowNodeMsgs
            {
                NodeId = nodeId
            }.Send();
        }
        public bool Set ( long id, NodeMsgSet datum )
        {
            return new SetFlowNodeMsg
            {
                Id = id,
                Datum = datum
            }.Send();
        }
        public void Add ( NodeMsgSet datum )
        {
            new AddFlowNodeMsg
            {
                Datum = datum
            }.Send();
        }
    }
}
